Optimal. Leaf size=56 \[ -2 x^2 \cot \left (\frac {x}{2}\right ) \sqrt {a-a \cos (x)}+8 x \sqrt {a-a \cos (x)}+16 \cot \left (\frac {x}{2}\right ) \sqrt {a-a \cos (x)} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.10, antiderivative size = 56, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3319, 3296, 2638} \[ -2 x^2 \cot \left (\frac {x}{2}\right ) \sqrt {a-a \cos (x)}+8 x \sqrt {a-a \cos (x)}+16 \cot \left (\frac {x}{2}\right ) \sqrt {a-a \cos (x)} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2638
Rule 3296
Rule 3319
Rubi steps
\begin {align*} \int x^2 \sqrt {a-a \cos (x)} \, dx &=\left (\sqrt {a-a \cos (x)} \csc \left (\frac {x}{2}\right )\right ) \int x^2 \sin \left (\frac {x}{2}\right ) \, dx\\ &=-2 x^2 \sqrt {a-a \cos (x)} \cot \left (\frac {x}{2}\right )+\left (4 \sqrt {a-a \cos (x)} \csc \left (\frac {x}{2}\right )\right ) \int x \cos \left (\frac {x}{2}\right ) \, dx\\ &=8 x \sqrt {a-a \cos (x)}-2 x^2 \sqrt {a-a \cos (x)} \cot \left (\frac {x}{2}\right )-\left (8 \sqrt {a-a \cos (x)} \csc \left (\frac {x}{2}\right )\right ) \int \sin \left (\frac {x}{2}\right ) \, dx\\ &=8 x \sqrt {a-a \cos (x)}+16 \sqrt {a-a \cos (x)} \cot \left (\frac {x}{2}\right )-2 x^2 \sqrt {a-a \cos (x)} \cot \left (\frac {x}{2}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.04, size = 30, normalized size = 0.54 \[ 8 \left (x-\frac {1}{4} \left (x^2-8\right ) \cot \left (\frac {x}{2}\right )\right ) \sqrt {a-a \cos (x)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: TypeError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.37, size = 51, normalized size = 0.91 \[ 2 \, \sqrt {2} {\left (4 \, x \mathrm {sgn}\left (\sin \left (\frac {1}{2} \, x\right )\right ) \sin \left (\frac {1}{2} \, x\right ) - {\left (x^{2} \mathrm {sgn}\left (\sin \left (\frac {1}{2} \, x\right )\right ) - 8 \, \mathrm {sgn}\left (\sin \left (\frac {1}{2} \, x\right )\right )\right )} \cos \left (\frac {1}{2} \, x\right ) - 8 \, \mathrm {sgn}\left (\sin \left (\frac {1}{2} \, x\right )\right )\right )} \sqrt {a} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [C] time = 0.06, size = 69, normalized size = 1.23 \[ -\frac {i \sqrt {2}\, \sqrt {-a \left ({\mathrm e}^{i x}-1\right )^{2} {\mathrm e}^{-i x}}\, \left (4 i x \,{\mathrm e}^{i x}+x^{2} {\mathrm e}^{i x}-4 i x +x^{2}-8 \,{\mathrm e}^{i x}-8\right )}{{\mathrm e}^{i x}-1} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 1.38, size = 100, normalized size = 1.79 \[ {\left ({\left (4 \, \sqrt {2} x \cos \relax (x) + {\left (\sqrt {2} x^{2} - 8 \, \sqrt {2}\right )} \sin \relax (x) - 4 \, \sqrt {2} x\right )} \cos \left (\frac {1}{2} \, \pi + \frac {1}{2} \, \arctan \left (\sin \relax (x), \cos \relax (x)\right )\right ) - {\left (\sqrt {2} x^{2} - 4 \, \sqrt {2} x \sin \relax (x) + {\left (\sqrt {2} x^{2} - 8 \, \sqrt {2}\right )} \cos \relax (x) - 8 \, \sqrt {2}\right )} \sin \left (\frac {1}{2} \, \pi + \frac {1}{2} \, \arctan \left (\sin \relax (x), \cos \relax (x)\right )\right )\right )} \sqrt {a} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 0.34, size = 71, normalized size = 1.27 \[ \frac {2\,\sqrt {a}\,\sqrt {1-\cos \relax (x)}\,\left (8\,\cos \relax (x)-x^2\,\cos \relax (x)+4\,x\,\sin \relax (x)-x^2+8+x\,4{}\mathrm {i}+\sin \relax (x)\,8{}\mathrm {i}-x^2\,\sin \relax (x)\,1{}\mathrm {i}-x\,\cos \relax (x)\,4{}\mathrm {i}\right )}{\sin \relax (x)-\cos \relax (x)\,1{}\mathrm {i}+1{}\mathrm {i}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int x^{2} \sqrt {- a \left (\cos {\relax (x )} - 1\right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________